<?php

/**
 * @author Kartik
 * Access the MaxQuantity database fix the upper limit on books that will be accepted.
 */
class Buyback_Resource_Offer_Quantity{
	
	public static function getMaxQnty($source = null, $metrics = null){
		
		switch($source){
			case 'W':
			case 'A':
				$result = Doctrine_Model_QntyLimiterAmazon::fetchQntyAmz(array('rank'=>$metrics));
				break;
			case 'M':
				$result = Doctrine_Model_QntyLimiterMbs::fetchQntyMbs(array('activity_code'=>$metrics));
				break;
		}
		
		if($result){
			return $result;
		}
		
		return 0;
	}
	
}